<?php

namespace addons\shopro\library\teams;


use app\admin\model\shopro\teams\Config as ConfigModel;
use addons\shopro\model\User;
use think\Model;
use fast\Http;

/**
 *
 */
class Config
{
    protected $config = [];

    public function __construct()
    {
        $this->config = ConfigModel::column('value', 'name');
    }

    // 获取基础团队奖励
    public function getTeamRewardRate()
    {
        return json_decode($this->config['team_reward_rate'], true);
    }


    // 获取升级条件
    public function getRetailerNum()
    {
        return json_decode($this->config['retailer_num'], true);
    }

    //分佣逻辑
    public function getConfig()
    {
        return $this->config;
    }

    // 退款是否扣除佣金
    public function getRefundTeamReward()
    {
        return boolval($this->config['refund_reward']);
    }
}
